package com.kingwang.training.designpattern.simplefactory.sms;

public final class SmsSenderFactory {
    public static SmsSender create(String areaCode) {
        switch (areaCode) {
            case "37":
//                ShandongSmsSenderFactory factory = new ShandongSmsSenderFactory();
//                return factory.create();
                return new ShandongSmsSender();
            case "11":
                return new BeijingSmsSender();
            case "13":
                return new HebeiSmsSender();
            default:
                throw new IllegalArgumentException("非法的areacode");
        }
    }
}
